home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / inventor / SpaceballViewer / SvManipList.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.7 KB  |  85 lines

  1. /*
  2.  * Copyright (c) 1990-1992, 1994 Silicon Graphics, Inc.
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that the name of Silicon Graphics may not be used in any advertising or
  7.  * publicity relating to the software without the specific, prior written
  8.  * permission of Silicon Graphics.
  9.  *
  10.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  11.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  12.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  13.  *
  14.  * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  15.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
  16.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE
  17.  * POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN
  18.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19.  */
  20. //  -*- C++ -*-
  21.  
  22. /*
  23.  * Copyright (C) 1990,91,92   Silicon Graphics, Inc.
  24.  *
  25.  _______________________________________________________________________
  26.  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
  27.  |
  28.  |   $Revision: 1.1004 $
  29.  |
  30.  |   Classes:    SvManipList
  31.  |
  32.  |   Author(s):    David Mott
  33.  |
  34.  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
  35.  _______________________________________________________________________
  36.  */
  37.  
  38. #ifndef  _SV_MANIP_LIST_
  39. #define  _SV_MANIP_LIST_
  40.  
  41.  
  42. // This class helps keep track of 
  43. // selectionPath/manip/xfPath triplets.
  44.  
  45. class SbPList;
  46. class SoPath;
  47. class SoTransformManip;
  48.  
  49. // You can add a selectionPath/manip/xfPath triplet to the list.
  50. // Methods let you find the index of this triplet based on any of the three
  51. // things.  You can then use the index to get the selectionPath, manip, or
  52. // xfPath, or remove the triplet from the list.
  53.  
  54. class SvManipList {
  55.   public:
  56.     SvManipList();
  57.     ~SvManipList();
  58.     
  59.     int            getLength() const;
  60.  
  61.     // append will ref() the paths and the manip
  62.     void        append(SoPath *selectionP, 
  63.                SoTransformManip *m, SoPath *xfP);
  64.     
  65.     // return the index of the triplet.
  66.     // use this index in calls to:
  67.     // remove(), getSelectionPath(), getManip(), getXfPath()
  68.     int            find(const SoPath *p) const;
  69.     int            find(const SoTransformManip *m) const;
  70.     int            findByXfPath(const SoPath *p) const;
  71.     
  72.     // remove will unref() the paths and the manip
  73.     void        remove(int which);
  74.     
  75.     // these return the paths or the manip.
  76.     SoPath *           getSelectionPath(int which) const;
  77.     SoTransformManip * getManip(int which) const;
  78.     SoPath *           getXfPath(int which) const;
  79.   
  80.   private:
  81.     SbPList *        list;
  82. };
  83.  
  84. #endif // _SV_MANIP_LIST_
  85.